home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COMM.SWG / 0076_Term program for turbo.pas < prev   
Pascal/Delphi Source File  |  1995-02-28  |  1KB  |  40 lines

  1. {
  2. Heres a simple term program....  no frills except that it writes to dos's
  3. putchar so that it supports ANSI!....     Public domain!
  4.  
  5. can anybody tell me how to change the speed of a COM port?
  6.  
  7. {----------------------CUT-----------------------------}
  8. {Simple com program by Ira Gardiner....  all from scratch!}
  9. uses crt;
  10.  
  11. Const
  12.   { (1=$03F8 2=$02F8 3=$03E8 4=$02E8 }
  13.   Com = $2f8; {base address of com port 2}
  14.  
  15. Procedure Write(w : char);  {Quick and dirty write to Dos's FAST PUTCHAR}
  16. begin                       {It only writes one char though! that's all it's}
  17.                             {supposed to!}
  18.  asm
  19.   mov al, w;
  20.   int $29
  21.  end;
  22. end;
  23.  
  24. var
  25.  c : char;
  26.  done : boolean;
  27.  
  28. begin
  29.   done := false;
  30.   repeat
  31.    if keypressed then
  32.        begin
  33.           c := readkey;
  34.           if c = #27 then done := true;  {if you press ESC it quits!}
  35.           port[com] := ord(c);
  36.        end;
  37.    if  97 = port[com+5] then write(char(port[com]));
  38.   until done = true;
  39. end.
  40.